﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraFollow : MonoBehaviour {

    public Transform Target;

    private Vector3 offset;
    private float moveSpeed = 7;

	// Use this for initialization
	void Start ()
    {
        offset = transform.position - Target.position;
	}

    private void LateUpdate()
    {
        //相机x轴坐标始终不变
        transform.position = Vector3.Lerp(transform.position,new Vector3(transform.position.x,Target.position.y+offset.y,Target.position.z+offset.z),moveSpeed*Time.deltaTime);
    }

    
}
